Student Name
October 10, 2017
This assignment covers some beginning analysis exercises and an introduction to Python programming that covers basic operations to get you started building data science notebooks.
1: Problem Statement
2: Data Profile & Discovery
3: Hypothesis Statement
4: Data Preparation
5: Model Development
6: Model Evaluation
1: Project Manager
2: Domain Expert
3: Data Engineer
4: Data Scientist
5: Graphic Designer
Using the World Bank - Population Data Site, complete the following analysis tasks: (You may use any tools for this excercise)
In [14]:
# a. take a list of [2, 3, 4] and multiply it by 3 to get [6, 9, 12]
a = [1, 2, 3]
In [10]:
# b Return count of 'white' in list
colors = ['red', 'white', 'blue', 'white', 'purple', 'brown', 'white']
In [11]:
# c Add value 'green' to color list below
colors = ['red', 'white', 'blue', 'white', 'purple', 'brown', 'white']
In [ ]:
# a Add an additional value [c:30] to the following dictionary
tens = {a:10, b:20}
In [ ]:
# b Print the value of 'b'
tens = {a:10, b:20, c:30}
In [ ]:
# c Merge the following two dictionaries in a single new dictionary
t1 = {'a': 100, 'b': 200}
t2 = {'c': 300, 'd': 400}
In [19]:
# a Using the range() function, write a short for loop to print numbers from 1 to 10:
In [20]:
# b Write a short while loop to create a list of numbers from 1 to 10
a = []
# Loop
print(len(a))
In [21]:
# c Write a short loop from 1 to 100. Print 'fizz' if the number if evenly divisible by 3, print 'buzz'
# if the number is evenly divisible by 5, and print 'fizzbuzz' if number is divisible by both 3 and 5.
In [25]:
# a Print the current date in the format: "Month, Day Year"
from datetime import date
In [32]:
# b Calculate the number of days between the following two dates:
from datetime import date
d1 = date(2016, 10, 3)
d2 = date(2017, 10, 3)
In [33]:
# c Print current date and time in the format: 'YYYY-MM-DD HH:MM:SS'
import datetime
In [42]:
# a complete the following to load the data file and print the number of rows
import csv
import requests
url = 'http://winterolympicsmedals.com/medals.csv'
r = requests.get(url)
In [44]:
# b complete the following to save the file to a local copy: (open('dataset.csv', 'w'))
import urllib.request
url = 'http://samplecsvs.s3.amazonaws.com/Sacramentorealestatetransactions.csv'
In [45]:
# c complete the following to read a local file: (open('dataset.csv', 'r'))
import csv
Single Dice Game (You may use any tools for this excercise)
What is the expected average payout you will receive playing this game?